﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DesignPattern.FactoryPattern
{
    /// <summary>
    /// 定义创建对象的工厂
    /// </summary>
    public class CreateFactory
    {
        public static BaseObject GetObject(string name)
        {
            switch (name.ToUpper())
            {
                default:
                case "A":
                    return new ObjectA();
                case "B":
                    return new ObjectB();
            }
        }
    }
}
